package com.emex.app.web.service;

import com.emex.app.shared.data.ProfitType;
import com.emex.app.shared.data.ProfitTypeExample;
import com.emex.app.shared.persistance.ProfitTypeMapper;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Sergey Karavaev
 */
@Service
@Transactional
public class ProfitTypeService {

    @Autowired
    private ProfitTypeMapper profitMapper;

    public int deleteProfitTypeByPrimaryKey(Integer id) {
        return profitMapper.deleteByPrimaryKey(id);
    }

    public ProfitType insertProfitType(ProfitType record) {
        profitMapper.insert(record);
        return record;
    }

    public List<ProfitType> selectProfitTypeByExample(ProfitTypeExample example) {
        return profitMapper.selectByExample(example);
    }

    public List<ProfitType> getAllProfitTypes() {
        return selectProfitTypeByExample(null);
    }

    public ProfitType updateProfitType(ProfitType record) {
        profitMapper.updateByPrimaryKey(record);
        return record;
    }

    public ProfitType selectProfitTypeByPrimaryKey(Integer id) {
        return profitMapper.selectByPrimaryKey(id);
    }
}

